ostree.git
12 years agopull: Add a few more g_debug() and assertions
Colin Walters [Sun, 19 Jan 2014 17:39:18 +0000 (12:39 -0500)]
pull: Add a few more g_debug() and assertions

To help track down the race condition better.

12 years agotests: Small tweaks to pull corruption test
Colin Walters [Sun, 19 Jan 2014 16:48:27 +0000 (11:48 -0500)]
tests: Small tweaks to pull corruption test

This one is failing here, I suspect it's the generic pull race
condition, but these fixes should make it slightly more reliable.

12 years agoUpdate .gitignore
Colin Walters [Sun, 19 Jan 2014 16:33:35 +0000 (11:33 -0500)]
Update .gitignore

12 years agodeploy/main: Unify some bits between admin-switch and admin-upgrade
Colin Walters [Sun, 19 Jan 2014 16:28:30 +0000 (11:28 -0500)]
deploy/main: Unify some bits between admin-switch and admin-upgrade

12 years agotest-sysroot: Update for API change
Colin Walters [Sat, 18 Jan 2014 22:50:22 +0000 (17:50 -0500)]
test-sysroot: Update for API change

12 years agoadmin/switch: New builtin to switch between trees
Colin Walters [Sat, 18 Jan 2014 22:42:24 +0000 (17:42 -0500)]
admin/switch: New builtin to switch between trees

This is something I want to make easier, as it better showcases the
flexibility of OSTree.

12 years agoSquash some harmless compiler warnings
Colin Walters [Sat, 18 Jan 2014 09:53:16 +0000 (04:53 -0500)]
Squash some harmless compiler warnings

None of these AFAICS actually can occur, but let's silence gcc.

12 years agolibotutil: Fix a possible uninitialized free() in error path
Colin Walters [Sat, 18 Jan 2014 09:52:45 +0000 (04:52 -0500)]
libotutil: Fix a possible uninitialized free() in error path

Spotted by gcc.

12 years agopackaging: Update infrastructure
Colin Walters [Sat, 18 Jan 2014 09:44:54 +0000 (04:44 -0500)]
packaging: Update infrastructure

The Makefile.dist-packaging lives canonically in rpm-ostree/ for now,
it's my latest hack to automate git -> (s)rpm.

Update the spec.in from current Fedora.

12 years agocommit: Reject non-regular/non-symlinks earlier with better error message
Colin Walters [Fri, 17 Jan 2014 15:32:34 +0000 (10:32 -0500)]
commit: Reject non-regular/non-symlinks earlier with better error message

Also avoid _NOT_SUPPORTED as that triggers the --help behavior from
the commandline; just use _FAILED.

https://bugzilla.gnome.org/show_bug.cgi?id=722410

12 years agodeploy: Rework kernel arguments, add --karg-append to "admin deploy"
Colin Walters [Thu, 16 Jan 2014 18:04:00 +0000 (13:04 -0500)]
deploy: Rework kernel arguments, add --karg-append to "admin deploy"

The "ordered hash" code was really just for kernel arguments.  And it
turns out it needs to be a multihash (for e.g. multiple console=
arguments).

So turn the OstreeOrderedHash into OstreeKernelArgs, and move the bits
to split key=value and such into there.

Now we're not making this public API yet - the public OstreeSysroot
just takes char **kargs.  To facilitate code reuse between ostree/ and
libostree/, make it a noinst libtool library.  It'll be duplicated in
the binary and library, but that's OK for now.  We can investigate
making OstreeKernelArgs public later.

https://bugzilla.gnome.org/show_bug.cgi?id=721136

12 years agoCOPYING: Update to latest FSF with current address
Colin Walters [Thu, 16 Jan 2014 15:20:47 +0000 (10:20 -0500)]
COPYING: Update to latest FSF with current address

Hooray for rpmlint.

12 years agoUnify uboot and syslinux test cases
Colin Walters [Wed, 15 Jan 2014 14:48:04 +0000 (09:48 -0500)]
Unify uboot and syslinux test cases

The test-admin-deploy-1 was copied into -uboot at some point.  But
really they should be testing exactly the same thing, except for
the bootloader backend.

Unify these tests by extracting a common test core.

12 years agoUpdate libgsystem
Colin Walters [Wed, 15 Jan 2014 14:19:09 +0000 (09:19 -0500)]
Update libgsystem

This has a GsConsole fix.

12 years agoadmin: Add --karg-proc-cmdline argument
Colin Walters [Mon, 13 Jan 2014 13:45:56 +0000 (08:45 -0500)]
admin: Add --karg-proc-cmdline argument

When installing a new tree inside an existing OS, this is a convenient
way to include the command line arguments one needs (such as root=).

12 years agodeploy: Write bootloader config even if just kernel arguments changed
Colin Walters [Wed, 15 Jan 2014 13:46:05 +0000 (08:46 -0500)]
deploy: Write bootloader config even if just kernel arguments changed

The official way to add bootloader arguments to the current deployment
is to redeploy with --karg.  However, doing so tripped up an
optimization made inside the deployment code to just swap the
bootlinks if we're keeping the same "bootcsum".

Change this optimization to look at the pair of (bootcsum, options).

12 years agobuild: Don't use += for ACLOCAL_AMFLAGS
Colin Walters [Sat, 11 Jan 2014 17:02:34 +0000 (10:02 -0700)]
build: Don't use += for ACLOCAL_AMFLAGS

It confuses the autotools.

12 years agopull: Ensure we begin a status line
Colin Walters [Fri, 10 Jan 2014 13:15:54 +0000 (08:15 -0500)]
pull: Ensure we begin a status line

Otherwise if the operation completes before anything happens, we hit
an assertion trying to end a status line when we didn't begin one.

12 years agosysroot: Error out on deploy --os=<unknown> which has not been initialized
Colin Walters [Wed, 8 Jan 2014 23:29:05 +0000 (18:29 -0500)]
sysroot: Error out on deploy --os=<unknown> which has not been initialized

We should hard require "ostree admin os-init foo" before letting
deployments go there; it's too easy to typo the argument.

12 years agoMakefile-decls.am: Some minor fixes from hotssh
Colin Walters [Fri, 3 Jan 2014 16:43:31 +0000 (11:43 -0500)]
Makefile-decls.am: Some minor fixes from hotssh

12 years agobuild: Add Makefile-decls.am
Colin Walters [Fri, 3 Jan 2014 16:39:27 +0000 (11:39 -0500)]
build: Add Makefile-decls.am

I'll be sharing this across more of my projects.

12 years agoRemove 'write-refs' builtin
Colin Walters [Wed, 25 Dec 2013 19:24:49 +0000 (14:24 -0500)]
Remove 'write-refs' builtin

See https://bugzilla.gnome.org/show_bug.cgi?id=705979

This was just a performance hack for gnome-continuous back before it
used libostree via g-i.

12 years agoostree/remote-add: Add --no-gpg-verify option
Colin Walters [Wed, 25 Dec 2013 19:17:36 +0000 (14:17 -0500)]
ostree/remote-add: Add --no-gpg-verify option

To more conveniently disable GPG verification.

12 years agorepo: Introspect _sign_commit() and _verify_commit()
Colin Walters [Mon, 23 Dec 2013 16:40:57 +0000 (11:40 -0500)]
repo: Introspect _sign_commit() and _verify_commit()

We can't use #ifdef in the headers, since then g-ir-scanner won't pick
up the functions (unless we included config.h).  Let's instead always
have the symbols, but just set an error if we were built without
support for it, just like how pull works.

12 years agoprune: Remove redundant 'bytes' in format string
Colin Walters [Fri, 20 Dec 2013 22:44:13 +0000 (17:44 -0500)]
prune: Remove redundant 'bytes' in format string

12 years agorepo: Provide a friendlier error message if no signatures are found
Colin Walters [Wed, 18 Dec 2013 04:00:01 +0000 (23:00 -0500)]
repo: Provide a friendlier error message if no signatures are found

I always forget the key to disable it...

12 years agorepo-pull: Remove leftover unused %s
Colin Walters [Mon, 16 Dec 2013 23:24:03 +0000 (18:24 -0500)]
repo-pull: Remove leftover unused %s

12 years agocore: Set mtime of content objects to 0
Roddy Shuler [Thu, 12 Dec 2013 22:56:19 +0000 (14:56 -0800)]
core: Set mtime of content objects to 0

This is necessary to satisfy tools such as guile and python, which
compare mtimes to determine whether or not source files need to be
compiled.

https://bugzilla.gnome.org/show_bug.cgi?id=720363

12 years agoTODO: Add a few items
Colin Walters [Fri, 29 Nov 2013 04:45:56 +0000 (23:45 -0500)]
TODO: Add a few items

12 years agoUpdate libgsystem
Colin Walters [Fri, 29 Nov 2013 04:45:48 +0000 (23:45 -0500)]
Update libgsystem

12 years agoMove xattr handling into libgsystem, fix sysroot to handle directory ownership/perms
Colin Walters [Tue, 19 Nov 2013 00:47:46 +0000 (19:47 -0500)]
Move xattr handling into libgsystem, fix sysroot to handle directory ownership/perms

This large patch moves the core xattr logic down into libgsystem,
which allows the gs_shutil_cp_a() API to copy them.  In turn, this
allows us to just use that API instead of rolling our own recursive
copy here.

As noted in the new comment though, one case that we are explicitly
regressing is where the new /etc removes a parent directory that's
needed by a modified file.  This seems unlikely for most vendors now,
but let's do that as a separate bug.

https://bugzilla.gnome.org/show_bug.cgi?id=711058

12 years agoostree-remount.service: Run before systemd-random-seed.service
Colin Walters [Fri, 22 Nov 2013 21:42:20 +0000 (16:42 -0500)]
ostree-remount.service: Run before systemd-random-seed.service

It's essential that we've mounted /var read-write in order for
random-seed.service to work.

12 years agofetcher: Display incremental download progress
Colin Walters [Thu, 21 Nov 2013 19:34:47 +0000 (14:34 -0500)]
fetcher: Display incremental download progress

Previously the progress meter would bump in large chunks after we
completed a download.  Instead, poll in progress files via fstat() for
their size, and add those to the running total.

12 years agoUpdate libgsystem
Colin Walters [Mon, 4 Nov 2013 02:35:45 +0000 (21:35 -0500)]
Update libgsystem

For https://bugzilla.gnome.org/show_bug.cgi?id=711057

12 years agomain: Treat default osname more consistently
Colin Walters [Sun, 27 Oct 2013 20:41:40 +0000 (16:41 -0400)]
main: Treat default osname more consistently

The libostree already treats passing NULL for osname as "booted
osname, if any".  We should do the same inside the tools.  The upgrade
builtin had this logic duplicated there; we should be able to safely
remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=710970

12 years agoFix crash when deploying with implicit os name
Daniel Narvaez [Sun, 27 Oct 2013 18:39:02 +0000 (19:39 +0100)]
Fix crash when deploying with implicit os name

When booted into an ostree you can deploy without passing
an --os option. That was crashing though, because
ot_admin_complete_deploy_one is called with NULL
osname but it was not handling it properly.

https://bugzilla.gnome.org/show_bug.cgi?id=710970

12 years agomain/remote: Add a show-url operation to the remote command
Daniel Narvaez [Sun, 27 Oct 2013 17:20:12 +0000 (18:20 +0100)]
main/remote: Add a show-url operation to the remote command

Useful to get the remote url in scripts.

https://bugzilla.gnome.org/show_bug.cgi?id=710967

12 years agolibostree: Remove extra : in comment
Colin Walters [Fri, 25 Oct 2013 00:32:20 +0000 (20:32 -0400)]
libostree: Remove extra : in comment

g-ir-scanner handles this, but it stuck out.

12 years agolibostree: Squash a compiler warning
Colin Walters [Thu, 24 Oct 2013 18:37:50 +0000 (14:37 -0400)]
libostree: Squash a compiler warning

12 years agolibostree: Squash two g-ir-scanner warnings
Colin Walters [Thu, 24 Oct 2013 18:37:35 +0000 (14:37 -0400)]
libostree: Squash two g-ir-scanner warnings

12 years agoAdd support for mkinitcpio
Daniel Narvaez [Tue, 22 Oct 2013 20:04:32 +0000 (22:04 +0200)]
Add support for mkinitcpio

https://bugzilla.gnome.org/show_bug.cgi?id=710682

12 years agoAdd OstreeAsyncProgress, use it for ostree_repo_pull
Colin Walters [Thu, 24 Oct 2013 13:10:34 +0000 (09:10 -0400)]
Add OstreeAsyncProgress, use it for ostree_repo_pull

Several APIs in libostree were moved there from the commandline code,
and have hardcoded g_print() for progress and notifications.  This
isn't useful for people who want to write PackageKit backends, custom
GUIs and the like.

From what I can tell, there isn't really a winning precedent in GLib
for progress notifications.

PackageKit has the model where the source has GObject properties that
change as async ops execute, which isn't bad...but I'd like something
a bit more general where say you can have multiple outstanding async
ops and sensibly track their state.

So, OstreeAsyncProgress is basically a threadsafe property bag with a
change notification signal.

Use this new API to move the GSConsole usage (i.e. g_print()) out from
libostree/ and into ostree/.

12 years agoUpdate libgsystem
Colin Walters [Wed, 23 Oct 2013 19:43:29 +0000 (15:43 -0400)]
Update libgsystem

Just to test the new code.

12 years agocore: Add size information to commit metadata
Jeremy Whiting [Wed, 9 Oct 2013 02:44:39 +0000 (20:44 -0600)]
core: Add size information to commit metadata

Add a --generate-sizes option to commit to add size information to the
commit metadata.  This will be used by higher level code which wants
to determine the total size necessary for downloading.

12 years agoRelease 2013.7
Colin Walters [Tue, 15 Oct 2013 20:20:08 +0000 (16:20 -0400)]
Release 2013.7

12 years agorepo: Remove set-but-unused variable
Colin Walters [Tue, 15 Oct 2013 20:41:07 +0000 (16:41 -0400)]
repo: Remove set-but-unused variable

The gpgme examples use this, but from what I can tell we don't really
need to because we don't need detailed results; we only care whether
we signed it at all.

12 years agotrivial: Add missing files to dist
Colin Walters [Tue, 15 Oct 2013 20:30:09 +0000 (16:30 -0400)]
trivial: Add missing files to dist

12 years agotrivial: Don't include config.h in headers
Colin Walters [Tue, 15 Oct 2013 19:26:37 +0000 (15:26 -0400)]
trivial: Don't include config.h in headers

This should be included by each .c file.  This fixes using libostree
from a "plain" project without config.h.

12 years agosysroot: Handle deleting directories in /etc
Colin Walters [Tue, 15 Oct 2013 18:11:43 +0000 (14:11 -0400)]
sysroot: Handle deleting directories in /etc

We need to use the full shutil_rm_rf() in order to actually delete
complete directories.

Test suite code based on a patch from Sjoerd Simons <sjored@luon.net>

https://bugzilla.gnome.org/show_bug.cgi?id=710097

12 years agocore: Add code to read/write "varints"
Colin Walters [Thu, 15 Aug 2013 13:03:21 +0000 (09:03 -0400)]
core: Add code to read/write "varints"

Adapted from Google protobufs.  For several cases, we want to support
e.g. file sizes up to guint64, but paying the cost of 8 bytes for each
number is too high.

This will be used for static deltas and sizes metadata.

12 years agobuild: Also make gjs-based tests conditional on introspection support
Colin Walters [Fri, 11 Oct 2013 15:50:15 +0000 (11:50 -0400)]
build: Also make gjs-based tests conditional on introspection support

Since they use imports.gi.OSTree.

12 years agoUpdate libgsystem
Jasper St. Pierre [Wed, 9 Oct 2013 20:17:35 +0000 (16:17 -0400)]
Update libgsystem

12 years agolibostree: Fix an introspection scanner warning
Colin Walters [Wed, 9 Oct 2013 16:53:12 +0000 (12:53 -0400)]
libostree: Fix an introspection scanner warning

12 years agorepo: Tweak traversal API
Colin Walters [Wed, 9 Oct 2013 16:05:56 +0000 (12:05 -0400)]
repo: Tweak traversal API

It's convenient for bindings if we have a version that doesn't mutate
the hash table, because they pass temporary hash tables as input.

12 years agotests: Extend test-sysroot.js further
Colin Walters [Thu, 3 Oct 2013 22:33:18 +0000 (18:33 -0400)]
tests: Extend test-sysroot.js further

Now covers a lot more of the API.

12 years agosysroot: Move ostree_sysroot_origin_new_from_refspec here
Colin Walters [Thu, 3 Oct 2013 22:32:41 +0000 (18:32 -0400)]
sysroot: Move ostree_sysroot_origin_new_from_refspec here

Rather than having it live in admin.  This is useful for other
consumers like the test suite.

12 years agosysroot: Ensure we create /boot/loader.%d/entries even if there are no deployments
Colin Walters [Thu, 3 Oct 2013 22:31:07 +0000 (18:31 -0400)]
sysroot: Ensure we create /boot/loader.%d/entries even if there are no deployments

Not doing so breaks things, and we should support this.

12 years agosysroot: Avoid bad double-free
Colin Walters [Thu, 3 Oct 2013 22:30:07 +0000 (18:30 -0400)]
sysroot: Avoid bad double-free

If a deployment is somehow in the list twice, the hash table will free
the *new* value with g_hash_table_insert which gets all broken.  Just
use g_hash_table_replace().

12 years agosysroot: Update some annotations
Colin Walters [Thu, 3 Oct 2013 22:29:40 +0000 (18:29 -0400)]
sysroot: Update some annotations

We were double-freeing before.

12 years agosysroot: Support more arbitrary deployment changes
Colin Walters [Tue, 17 Sep 2013 02:37:00 +0000 (22:37 -0400)]
sysroot: Support more arbitrary deployment changes

This commit changes the sysroot API so that one can create arbitrary
new deployment checkouts, then commit them as one step.  This is to
enable things like an automatic bisection tool which say create 50
deployments at once, then when done clean them up.

This also moves some printfs from the library into src/ostree.

12 years agotests: Add a simple test-sysroot.js that covers OSTree.Sysroot
Colin Walters [Wed, 2 Oct 2013 23:47:38 +0000 (19:47 -0400)]
tests: Add a simple test-sysroot.js that covers OSTree.Sysroot

This will be more interesting as a test case user of the API.

12 years agorepo: Only delete temp files older than a day
Colin Walters [Wed, 2 Oct 2013 13:00:10 +0000 (09:00 -0400)]
repo: Only delete temp files older than a day

This is somewhat lame, but to do better we need a reliable
multiprocess synchronization mechanism.

https://bugzilla.gnome.org/show_bug.cgi?id=709115

12 years agorepo: Enumerate objects using openat() too, make more efficient
Colin Walters [Mon, 30 Sep 2013 12:51:25 +0000 (08:51 -0400)]
repo: Enumerate objects using openat() too, make more efficient

This drops several calls to malloc()/g_object_new() per object
enumeration.  Just a followup to using openat() and friends in other
places.

12 years agocore: Make ostree_get_relative_object_path() private
Colin Walters [Mon, 30 Sep 2013 00:17:18 +0000 (20:17 -0400)]
core: Make ostree_get_relative_object_path() private

I plan to rename all of these APIs to use the term 'loose', so that it
makes more sense after pack files are introduced.  External users
should not use them; instead use _load_variant() or _read_commit().

12 years agopull: Verify commits with gpg signatures from detached metadata
Jeremy Whiting [Thu, 5 Sep 2013 18:50:36 +0000 (12:50 -0600)]
pull: Verify commits with gpg signatures from detached metadata

This uses gpgv for verification against DATADIR/ostree/pubring.gpg by
default.  The keyring can be overridden by specifying OSTREE_GPG_HOME.

Add a unit test for commit signing with gpg key and verifying on pull;
to implement this we ship a test GPG key generated with no password
for Ostree Tester <test@test.com>.

Change all of the existing tests to disable GPG verification.

12 years agocommit: Store detached metadata in normal form
Colin Walters [Sun, 29 Sep 2013 18:00:53 +0000 (14:00 -0400)]
commit: Store detached metadata in normal form

Otherwise corrupted variants may crash us.

12 years agocore: Use libgpgme to add GPG signatures to detached metadata for commit object
Jeremy Whiting [Tue, 3 Sep 2013 01:43:49 +0000 (19:43 -0600)]
core: Use libgpgme to add GPG signatures to detached metadata for commit object

Add an optional dependency on gpgme to add GPG signatures into the
detached metadata, with the key "ostree.gpgsigs", as an "aay", an
array of signatures (treated as binary data).

The commit command gains a --gpg-sign=<key-id> argument.  Also add an
argument --gpg-homedir to set the GPG homedir where we look for
keyrings.

12 years agoremote-add: Add --set=KEY=VALUE option
Colin Walters [Sat, 28 Sep 2013 16:00:16 +0000 (12:00 -0400)]
remote-add: Add --set=KEY=VALUE option

This can be used to add a remote and set e.g. tls-permissive=true, or
gpgverify=false.

12 years agoshow: Handle keys of any type, and set an error if key doesn't exist
Colin Walters [Fri, 27 Sep 2013 16:55:07 +0000 (12:55 -0400)]
show: Handle keys of any type, and set an error if key doesn't exist

Previously we were just handling strings, and silently doing nothing
if the key didn't exist, which is pretty broken.

12 years agorepo-pull: Allocate with g_new0 rather than g_new.
Colin Walters [Thu, 26 Sep 2013 18:38:37 +0000 (14:38 -0400)]
repo-pull: Allocate with g_new0 rather than g_new.

Conflicts:

src/libostree/ostree-repo-pull.c

12 years agopull: Also fetch detached commitmeta files
Colin Walters [Thu, 26 Sep 2013 18:00:36 +0000 (14:00 -0400)]
pull: Also fetch detached commitmeta files

These will contain GPG signatures and the like in the future, so we
should fetch them now.

12 years agorepo: When adding detached metadata, ensure the objdir exists
Colin Walters [Thu, 26 Sep 2013 17:59:08 +0000 (13:59 -0400)]
repo: When adding detached metadata, ensure the objdir exists

We may be creating the commitmeta file before the commit, so we need
to call mkdir(<first two checksum characters>) here too.

12 years agoshow: Print an error message if commit doesn't have detached metadata
Colin Walters [Thu, 26 Sep 2013 17:57:59 +0000 (13:57 -0400)]
show: Print an error message if commit doesn't have detached metadata

...instead of segfaulting.

12 years agofetcher: Fix previous commit
Colin Walters [Tue, 24 Sep 2013 18:10:40 +0000 (14:10 -0400)]
fetcher: Fix previous commit

I was getting hangs in the test suite, and looking at the previous
commit, we were calling the async completion functions out of the
finalizer for the URI, which is weird.  I didn't analyze what's going
wrong, but what we really should be doing is processing our internal
queue after we've downloaded a file, and the request is about to be
finalized.

I suspect doing queue management from the finalizer created a circular
reference type situation.

This patch deduplicates the queue processing bits too.

https://bugzilla.gnome.org/show_bug.cgi?id=708126

12 years agofetcher: Add a queue to limit requests sent to soup
Sjoerd Simons [Sun, 15 Sep 2013 19:25:02 +0000 (21:25 +0200)]
fetcher: Add a queue to limit requests sent to soup

On a large ostree repository pulling over http slows to a crawl. Pulling
from localhost results in:
 5944 metadata, 63734 content objects fetched; 850509 KiB transferred in
 1106 seconds
In other words about 800KiB/s. Some profiling shows that essentially
all of the CPU goes into libsoup doing its request bookkeeping instead
of into the actual downloading.

Adding a simple queue to limit to number of active request sent into
libsoup makes for a dramatic improvement:
 5944 metadata, 63734 content objects fetched; 850509 KiB transferred
 in 89 seconds
So around 9450 KiB/s.

https://bugzilla.gnome.org/show_bug.cgi?id=708126

12 years agotests: Add u-boot
Colin Walters [Sat, 21 Sep 2013 15:06:20 +0000 (11:06 -0400)]
tests: Add u-boot

It needs to be installed so it'll be run by the InstalledTests scheme.

12 years agotests: Fix U-Boot test case
Javier Martinez Canillas [Sat, 21 Sep 2013 01:35:55 +0000 (03:35 +0200)]
tests: Fix U-Boot test case

commit 08b873457 ("deploy: Remove checksum from generated loader entries")
changed the generated loader entries file names thus making the U-Boot test
case to fail since this test parsed those files.

Fix test-admin-deploy-uboot.sh by looking to the updated files names.

https://bugzilla.gnome.org/show_bug.cgi?id=708511

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
12 years agolibostree: Document and annotate some methods to quash g-ir-scanner warnings
Colin Walters [Fri, 20 Sep 2013 18:00:31 +0000 (14:00 -0400)]
libostree: Document and annotate some methods to quash g-ir-scanner warnings

Since warnings are bad.  Introspection is good.

12 years agolibostree: Remove private header file from ostree.h
Colin Walters [Fri, 20 Sep 2013 17:54:43 +0000 (13:54 -0400)]
libostree: Remove private header file from ostree.h

Was breaking pkgsys-ostree.

12 years agoupgrade: Don't segfault if there's no previous deployment
Colin Walters [Fri, 20 Sep 2013 13:42:50 +0000 (09:42 -0400)]
upgrade: Don't segfault if there's no previous deployment

Obviously.

12 years agodeploy: Correctly swap bootloader version with new boot checksums
Colin Walters [Fri, 20 Sep 2013 12:09:06 +0000 (08:09 -0400)]
deploy: Correctly swap bootloader version with new boot checksums

If we had two deployments with different boot checksums, and were
trying to remove the one that was the same and add a new one (the
normal case), we'd end up assuming due to comparison with 0 that
we only needed to do the fast subbootversion swap.

Fix this by actually putting 1 where we really mean 1.

And update the tests to verify the fix; I have double-verified by
undoing the fix, and noting that the test fails.

https://bugzilla.gnome.org/show_bug.cgi?id=708351

12 years agodeploy: Remove checksum from generated loader entries
Colin Walters [Fri, 20 Sep 2013 02:41:33 +0000 (22:41 -0400)]
deploy: Remove checksum from generated loader entries

The actual deployment checksum shouldn't be in there, because we may
just swap bootlinks, rendering the name of the old bootloader entry
file invalid.  Thankfully nothing actually parsed the names of these
files, so let's just use the index.

12 years agodeploy: Do a full system sync after writing bootloader config
Colin Walters [Fri, 20 Sep 2013 02:26:03 +0000 (22:26 -0400)]
deploy: Do a full system sync after writing bootloader config

This is just something I noticed on inspection; we should catch any
changes to /boot in the sync(), even though theoretically gio should
have done fdatasync().

12 years agodeploy: Only query bootloader if we have to make a loader change
Colin Walters [Fri, 20 Sep 2013 02:25:12 +0000 (22:25 -0400)]
deploy: Only query bootloader if we have to make a loader change

This will also help distinguish in the output when we're just swapping
bootlinks versus when we need to change the loader config.

12 years agodeploy: Some minor assertion and error message improvements
Colin Walters [Fri, 20 Sep 2013 02:09:48 +0000 (22:09 -0400)]
deploy: Some minor assertion and error message improvements

To help debug https://bugzilla.gnome.org/show_bug.cgi?id=708351

Plus run a status consistently in the tests.

12 years agolibostree: Add API to write metadata as stream
Colin Walters [Wed, 18 Sep 2013 22:44:57 +0000 (18:44 -0400)]
libostree: Add API to write metadata as stream

And use it in pull-local.  The goal here is to kill users of
ostree_repo_load_variant(), and move a bit more towards hiding the
variants.

12 years agotest-core.js: Add standard copyright header
Colin Walters [Wed, 18 Sep 2013 20:34:57 +0000 (16:34 -0400)]
test-core.js: Add standard copyright header

Like everything else.

12 years agomain: Print error: in red bold just for fun
Colin Walters [Wed, 18 Sep 2013 20:34:14 +0000 (16:34 -0400)]
main: Print error: in red bold just for fun

It's easier to see.  Also drop old dead ot_main() function.

12 years agotests: Add a gjs-based test
Colin Walters [Wed, 18 Sep 2013 16:01:46 +0000 (12:01 -0400)]
tests: Add a gjs-based test

This covers introspection, and in general is a much better way to get
API coverage tests.

12 years agosysroot: Look for booted deployment correctly
Colin Walters [Tue, 17 Sep 2013 14:53:41 +0000 (10:53 -0400)]
sysroot: Look for booted deployment correctly

We need to look at the list we just gathered, not potentially NULL.

12 years agosysroot: Clean up API
Colin Walters [Mon, 16 Sep 2013 13:13:58 +0000 (09:13 -0400)]
sysroot: Clean up API

Now that we have a real GObject for the sysroot, we have a convenient
place to keep track of 4 pieces of state:

* The current deployment list
* The current bootversion
* The current subbootversion
* The current booted deployment (if any)

Avoid requiring callers to pass all of this around and load it
piecemeal; instead the new thing is ostree_sysroot_load().

12 years agolibostree: Use ostree_repo_create() rather than spawning subprocess
Colin Walters [Mon, 16 Sep 2013 12:52:16 +0000 (08:52 -0400)]
libostree: Use ostree_repo_create() rather than spawning subprocess

We have API now, yay!

12 years agodoc: Add some more OstreeSysroot docs
Colin Walters [Mon, 16 Sep 2013 02:44:25 +0000 (22:44 -0400)]
doc: Add some more OstreeSysroot docs

12 years agolibostree: Make OstreeBootloader private
Colin Walters [Mon, 16 Sep 2013 00:26:13 +0000 (20:26 -0400)]
libostree: Make OstreeBootloader private

It was only temporarily public while functionality was being merged
down; that's done now.

12 years agoadmin: Drop two uses of ostree_sysroot_get_path()
Colin Walters [Mon, 16 Sep 2013 00:21:49 +0000 (20:21 -0400)]
admin: Drop two uses of ostree_sysroot_get_path()

Moving towards it being a full library.

12 years agolibostree: Nearly complete move of API into OstreeSysroot
Colin Walters [Mon, 16 Sep 2013 00:16:20 +0000 (20:16 -0400)]
libostree: Nearly complete move of API into OstreeSysroot

Move the deployment code too.

12 years agolibostree: Move a lot more sysroot API here
Colin Walters [Sun, 15 Sep 2013 22:07:34 +0000 (18:07 -0400)]
libostree: Move a lot more sysroot API here

OstreeBootloader is temporarily public API.

12 years agolibostree: Move sysroot initialization API here
Colin Walters [Sun, 15 Sep 2013 19:16:56 +0000 (15:16 -0400)]
libostree: Move sysroot initialization API here

12 years agoMove Deployment and BootconfigParser into libostree
Colin Walters [Sun, 15 Sep 2013 19:06:31 +0000 (15:06 -0400)]
Move Deployment and BootconfigParser into libostree

As part of moving admin functionality there.  While we are doing this,
rename OtConfigParser to OstreeBootConfig parser since it's a better
name.

12 years agolibostree: Add new OstreeSysroot class
Colin Walters [Sun, 15 Sep 2013 18:33:57 +0000 (14:33 -0400)]
libostree: Add new OstreeSysroot class

At the moment, just a container for a path, but we will start moving
admin functionality here.